Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!! - Mailing list pgsql-general

From Stuart Rison
Subject Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!!
Date
Msg-id v04020a08b37db8070684@[128.40.242.190]
Whole thread Raw
In response to Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!!  (selkovjr@mcs.anl.gov)
Responses Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!!  (selkovjr@mcs.anl.gov)
List pgsql-general
>> HELP!
>> WHAT'S GOING ON!!!
>> Why can't I get to pt->y?
>> Why does function pants behave just like get_x (and get_y)?
>
>If you write your function as double, you can't declare it as float in sql.

I thought something like that might have been the case I did try to declare
the return value as float in my get_<x|y> attempts but I didn't get
anywhere with it!

>What you wanted is probably this:
>

<snip code that works!! to Gene then the fame, power, fortune and good
looks (and I get my sanity back!>

I guess the bottom lines is that you can't really 'bluff' your way in 'C'
that easy and that I'll have to actually learn some if I want to get 'C'
functions to work!

This all steemed from me trying to write a standard deviation/variance set
of aggregate function.  This was just because a point seemed -at the time-
like quite a 'cute' way of storing to floats in one base type eliminating
the need for arrays (the two floats being the sum of elements and the sum
of the elements squared stored as the x and y coords of a point
respectively).

This means that if anybody is interested I now have these aggregate
functions working (needs PL/pgSQL as opposed to a solution previously
posted by Jan (Weick) which used Pl/Tcl).

Cheers,

S.



+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

pgsql-general by date:

Previous
From: selkovjr@mcs.anl.gov
Date:
Subject: Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!!
Next
From: Teodor Cimpoesu
Date:
Subject: Re: [PHP3] Help needed with regualr, or regexs expressions.